/*// 以下的脚本在必要时调用*/

var defaultSkin = "blue";
//风格切换
function SkinConvert(skin_name) {

	 
    var css_name = getParetnSkin(skin_name);
    $("#css_skin").attr("href", css_name);
 
    //..
    //保存到Cookie
    //引用 jquery.cookie
    var key =  $("#hf_SkinName").val();   ///用户帐号
    var value = skin_name;
     
    setSkinToCookie(key, value);
   // alert(key);
    var child = "themes/css/ui.c." + skin_name + ".css";
   
    var childSkinObject = main.document.getElementById("skin_css");
    if (childSkinObject != undefined)
        childSkinObject.href = child

    setSkinToCookie(key + ".child", child);
}

function getParetnSkin(theme){
	 return "themes/css/ui." + theme + ".css";
	
}

//设置皮肤
function setSkin(skin_url) {
    skin_url = skin_url.replace("'", "").replace("'", "");
    skin_url = getParetnSkin(skin_url);
 
    $("#css_skin").attr("href", skin_url);
}

//显示左侧导航栏
function ShowNav() {
    $("#page_main_left").show();
    $("#main_line_btn").removeClass();
    $("#main_line_btn").addClass("main_line_btna");

}
//隐藏左侧导航
function HideNav() {
    $("#page_main_left").hide();
    $("#main_line_btn").removeClass();
    $("#main_line_btn").addClass("main_line_btnb");
}
function nav_cbg(sum, val) {
    for (var i = 1; i <= 2; i++) {
        $("#cnav" + i).removeClass();
        $("#cnav" + i).addClass("PageChild_NavItem");
    }
    $("#cnav" + val).removeClass();
    $("#cnav" + val).addClass("PageChild_NavItemOK");
}

//返回..到列表
function backToList(divAddPanel, funAfter) {
    if (typeof funAfter != 'undefined')
        funAfter();
    return true;
}

var ErrorLi_Click_CallBack = function (e) { };



//显示授课安排的时候出现的冲突
function errorTipsli_Click() {
    $(".errorTips li").live("click", function () {
        var sender = $(this);
        var progress = "<img class=\"pro\" src=\"../themes/images/default/icons/loading.gif\" alt=\"\"/>";
        var container = $(this).find("div");

        if (container.length == 0) {
            sender.append(progress);
        }

        container.toggle();
        var toggleBtn = $(this).find(".toggle-button");

        var id = toggleBtn.attr("cid");
        // alert($(this).html());
        var isexpend = toggleBtn.attr("isexpend");
        isexpend = isexpend == undefined ? true : isexpend != 'false';

        //ajax 加载内容..
        if (isexpend == false) {
            $.ajax({
                type: "GET",
                cache: false,
                url: "../Module/simpleLectureFormGetter.ashx?lectureFormID=" + id,
                success: function (e) {
                    var context = "<div>" + e + "</div>";
                    sender.append(context);
                    sender.find("div").show("slow");
                    toggleBtn.attr("isexpend", "true");
                    sender.find(".pro").remove();
                }
            });
        }

    });
}

